<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li>首页</li>
              <li class="active">编辑项目信息</li>
            </ol>
          </div>
        </div>
        <div class="row h-main-search">
          <form action="javascript:;" method="post">
            <div class="pull-right h-btn-group">
              <button class="btn btn-info" id="return-btn" onclick="SystemProjectInfoMgr.returnIndex()"><i
                      class="fa fa-mail-reply">&nbsp;&nbsp;</i>返回
              </button>
              <button class="btn btn-info" id="save" onclick="SystemProjectInfoMgr.submitForm()" type="button"><i
                      class="fa fa-save">&nbsp;&nbsp;</i>保存
              </button>
            </div>
          </form>
        </div>

        <div class="form-horizontal  h-form-warp">
          <div class="h-msg-title h-table-header">
            <strong>项目信息</strong>
          </div>
          <form action="/systemProjectInfo/saveSystemProjectInfo" class="form-horizontal" id="systemProjectInfoForm"
                method="post" role="form">
            <input id="operation" name="operation" type="hidden" value="${operation!}"/>
            <input id="id" name="id" type="hidden" value="${systemProjectInfo.id!}"/>
            <input id="templateId" name="templateId" type="hidden" value="${systemProjectInfo.templateId!}"/>
            <div class="form-group">
              <label class="col-sm-2 control-label">项目代码：</label>
              <div class="col-sm-2">
                <input class="form-control" id="projectCode" name="projectCode" required="required"
                       type="text" value="${systemProjectInfo.projectCode!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
              <label class="col-sm-1 control-label">项目名称：</label>
              <div class="col-sm-3">
                <input class="form-control" id="projectName" name="projectName" required="required"
                       type="text" value="${systemProjectInfo.projectName!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <!-- <div class="form-group">
              <label class="col-sm-2 control-label">项目svn路径：</label>
              <div class="col-sm-7">
                <input type="text" id="projectSvnUrl" name="projectSvnUrl" class="form-control" value="${systemProjectInfo.projectSvnUrl!}" required="required"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">webService路径：</label>
              <div class="col-sm-7">
                <input type="text" id="projectWebserviceUrl" name="projectWebserviceUrl"
                  class="form-control" value="${systemProjectInfo.projectWebserviceUrl!}"
                  placeholder="通过web获其他系统下的数据库信息......" required="required"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div> -->
            <div class="form-group">
              <label class="col-sm-2 control-label">项目类型：</label>
              <div class="col-sm-7">
                <input class="form-control" id="projectType" name="projectType" required="required"
                       type="text" value="${systemProjectInfo.projectType!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">代码输出路径：</label>
              <div class="col-sm-7">
                <input class="form-control" id="projectAbsolutePath" name="projectAbsolutePath" required="required"
                       type="text" value="${systemProjectInfo.projectAbsolutePath!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">请选择模板：</label>
              <div class="col-sm-5">
                <input class="form-control" id="templateName" name="templateName" readonly="readonly"
                       required="required" type="text" value="${systemTemplateInfo.templateName!}"/>
              </div>
              <div class='col-sm-2'>
                <input class="primary-btn" id="selectTemplate" onclick="SystemProjectInfoMgr.selectTemplateInfo()"
                       type="button"
                       value='请选择'/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label">说明：</label>
              <div class="col-sm-7">
									<textarea class="col-sm-12" cols="" id="projectComment" name="projectComment" required="required"
                            rows="60" style="height:100px">${systemProjectInfo.projectComment!}</textarea>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>
<#include "/common/jslib.html">
<script type="text/javascript">
    function getTemplateInfo(templateStr) {
        var templates = templateStr.split("#");
        var templateId = templates[0];
        var templateCode = templates[1];
        var templateName = templates[2];
        $("#templateId").val(templateId);
        $("#templateName").val(templateCode + "---" + templateName);
    }
</script>
<!-- form页面js -->
<script type="text/javascript">
    $(function () {
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        var operation = $("#operation").val();
        SystemProjectInfoMgr = {
            // 初始化
            init: function () {
                // 查看的时候不显示保存按钮
                if (operation == "view") {
                    Jmts.setFormReadOnly();
                    $("#save").hide();
                }
                initDict(DICTURL, FORM, operation);//初始化数据字典
            },
            // init end

            // 提交数据
            submitForm: function () {
                Jmts.ajaxSubmit(document.getElementById("systemProjectInfoForm"), function (result) {
                    var operation = result.operation;
                    if (result.success) {
                        Jmts.succTips(result.msg);
                        if (operation == 'add') {
                            SystemProjectInfoMgr.returnIndex();
                        } else if (operation == 'edit') {
                            window.location.reload();
                        }
                    } else {
                        Jmts.errorTips(result.msg);
                    }
                });
                return false;
            },
            // submitForm end
            //返回
            returnIndex: function () {
                window.location.href = "/systemProjectInfo/query";
            },
            selectTemplateInfo: function () {
                var url = "/systemTemplateInfo/selectSystemTemplateInfo?returnMethod=getTemplateInfo&selectType=single";
                Jmts.openDialog("templateInfoId", url, "选择生成代码模板", 500, 700, 32);
            }
        };
        // 执行初始化
        SystemProjectInfoMgr.init();
        // 前台验证表单
        $("#systemProjectInfoForm").validate();
    });
</script>
</body>
</html>
